import * as React from 'react';
import { ManagerClient, ProcessEntity } from '@/api/workflow';
import { Card } from 'antd';
const { Meta } = Card;

class ProcessIndex extends React.PureComponent<any,any> {
    private client:ManagerClient;
    
    constructor(props:any){
        super(props);
        this.client = new ManagerClient();
    }
    public async componentWillMount(){
        let rs = await this.client.processList();
        this.setState({data:rs});
    }

    public render(){
        return (
            <div>
                {
                    (this.state.data as ProcessEntity[]).map(
                    d => 
                    <Card  key={d.id} style={{ width: 300 }} >
                    <Meta       
                        title={d.processName}
                        description="This is the description"
                        />
                    </Card>)
                }
            </div>
        );
    }
}

export default ProcessIndex;